<? include 'server_config.php'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>ugly duckly</title>
		<style type="text/css">
			<!--
				html, body
				{
					margin:0px;
					padding:0px;
					font-size: 11px; 
					font-family: '돋움';
					line-height: 13px; 
					text-align:center;
				}

				a:link {text-decoration: underline; color: black; font-size: 13px; }
				a:visited {text-decoration: underline; color: black;font-size: 13px;}
				a:active {text-decoration: underline; color: black;font-size: 13px;}
				a:hover {text-decoration: underline; color: red;font-size: 13px;}

			-->
		</style>
	</head>


	<body oncontextmenu='return false' ondragstart='return false' onselectstart='return false'>
		<div style='margin:0 auto; width:1282px; text-align:left;'>
			<div style='position:absolute;  width:1282px; '><!-- background-image: url("img/depth2_01_interiorwork2.jpg");' -->

				<!--상단 메뉴 로드-->
					<?
						include('top_menu.php');
					?>

				<!--페이지 상단 부분 시작-->

					<div style='float:left;width:997px;'>
						<div style='width:944px;height:20px;float:left;'><span></span></div>
						<div style='float:left;margin-left:53px;width:926px;'>
							<div style='width:180px;height:20px;float:left;'>
								<?
								if($_GET['type']==3)
								{
									?>
								<a href='p7.php'>목록으로 돌아가기</a>
									<?
								}
								else
								{
									?>


								<a href='p1.php?type=<? echo $_GET['type']; ?>'>목록으로 돌아가기</a>
								<?
								}
								?>
								
							</div>
							<div style='width:180px;height:20px;float:right;text-align:right;'>
								<?
								if($_GET['type']==2)
								{
									?>
								<a href='p6.php?type=<? echo $_GET['type']; ?>&idx=<? echo $_GET['idx']; ?>'>주문하기</a>
									<?
								}
								else
								{
									?>


								<a href='p5.php?type=<? echo $_GET['type']; ?>&idx=<? echo $_GET['idx']; ?>'>견적문의</a>
								<?
								}
								?>
								
							</div>
							<div style='width:926px;height:12px;float:left;'><span></span></div>

	<?

		$sql = "SELECT * FROM ud_work WHERE type='".$_GET['type']."' ANd idx='".$_GET['idx']."' ORDER BY reg_timestamp DESC;";
			
		$result = mysql_query($sql,$connect);

		$row = mysql_fetch_row($result);
	?>

							<div style='width:180px;height:20px;float:left;'>
								<img src='http://sajaa.cafe24.com/title_img.php?text=<? echo $row[4];?>'>
							</div>
							<div style='width:926px;height:10px;float:left;'><span></span></div>						
							<div style='width:926px;height:1px;background:#525051;float:left'><span></span></div>
							<div style='width:926px;height:18px;float:left;'><span></span></div>						
							<div style='width:926px;float:left;'>
								<img src='./admin/file/<? echo $row[3]; ?>' width='926px' border=0>
							</div>
							<div style='width:926px;height:10px;float:left;'><span></span></div>						

							<div style='width:926px;height:18px;float:left;'><span></span></div>						
							<div style='width:926px;height:1px;background:#525051;float:left'><span></span></div>
							<div style='width:926px;height:10px;float:left;'><span></span></div>						
							<div style='width:230px;height:20px;float:left;'>
								<?
								if($_GET['type']==3)
								{
									?>
								<a href='p7.php'>목록으로 돌아가기</a>
									<?
								}
								else
								{
									?>


								<a href='p1.php?type=<? echo $_GET['type']; ?>'>목록으로 돌아가기</a>
								<?
								}
								?>
								
							</div>
							<div style='width:230px;height:20px;text-align:right;float:left;'>
								
								

	<?

		$sql = "SELECT * FROM ud_work WHERE type='".$_GET['type']."' AND idx > ".$_GET['idx']." ORDER BY reg_timestamp ASC LIMIT 1;";
		
		$result = mysql_query($sql,$connect);

		$row = mysql_fetch_row($result);

	//	echo $row[0];

		if ($row[0]!="")
		{
	?>							
								<a href='p1_1.php?type=<? echo $_GET['type']; ?>&idx=<? echo $row[0];?>'>&lt;&lt;BACK</a>
	<?
		}
		else
		{
	?>
								
	<?
		}
	?>
								
								&nbsp;
							</div>

							<div style='width:230px;height:20px;float:left;'>
								&nbsp;
	<?

		$sql = "SELECT * FROM ud_work WHERE type='".$_GET['type']."' AND idx < ".$_GET['idx']." ORDER BY reg_timestamp DESC LIMIT 1;";
			
		$result = mysql_query($sql,$connect);

		$row = mysql_fetch_row($result);

	//	echo $row[0];

		if ($row[0]!="")
		{
	?>							
								<a href='p1_1.php?type=<? echo $_GET['type']; ?>&idx=<? echo $row[0];?>'>NEXT&gt;&gt;</a>
	<?
		}
		else
		{
	?>
								
	<?
		}
	?>
								
								
							</div>
							<div style='width:230px;height:20px;float:right;text-align:right;'>
								<?
								if($_GET['type']==2)
								{
									?>
								<a href='p6.php?type=<? echo $_GET['type']; ?>&idx=<? echo $_GET['idx']; ?>'>주문하기</a>
									<?
								}
								else
								{
									?>


								<a href='p5.php?type=<? echo $_GET['type']; ?>&idx=<? echo $_GET['idx']; ?>'>견적문의</a>
								<?
								}
								?>
								
							</div>
						</div>
					</div>


				<!--페이지 상단 부분 끝-->

				<!--메인 우측 부분 부분 로드-->
					<?
						include('main_right.php');
					?>



				<!--하단부 로드-->
					<?
						include('bottom.php');
					?>

			</div>
		</div>
	</body>
</html>